﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Collections.Generic;

public partial class JobSearchByExperience : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            Fillddls();
        }
    }

    protected void Fillddls()
    {
        try
        {
            // Functional Area
            clsFunctionalAreaDAL objclsFunctionalAreaDAL = new clsFunctionalAreaDAL();
            List<IN_TB_FUNCTIONAL_AREA> objIN_TB_FUNCTIONAL_AREA = new List<IN_TB_FUNCTIONAL_AREA>();
            objIN_TB_FUNCTIONAL_AREA = objclsFunctionalAreaDAL.GetAllFunctionalAreas();
            ddlFunctionalArea.Items.Clear();
            ddlFunctionalArea.AppendDataBoundItems = true;
            ddlFunctionalArea.DataTextField = "FUNCTIONAL_AREA";
            ddlFunctionalArea.DataValueField = "ID";
            ddlFunctionalArea.Items.Add("Select");
            ddlFunctionalArea.Items[0].Value = "0";
            ddlFunctionalArea.DataSource = objIN_TB_FUNCTIONAL_AREA;
            ddlFunctionalArea.DataBind();

            //Min Experience Required
            ddlMinExpRequired.Items.Clear();
            ddlMinExpRequired.AppendDataBoundItems = true;
            ddlMinExpRequired.Items.Add("Select");
            ddlMinExpRequired.Items[0].Value = "0";
            for (int i = 1; i <= 90; i++)
            {
                ddlMinExpRequired.Items.Add(i.ToString());
                ddlMinExpRequired.Items[i].Value = i.ToString();
            }
            ddlMinExpRequired.DataBind();

        }
        catch (Exception)
        {

            throw;
        }
    }
    protected void btnSeachBySkills_Click(object sender, EventArgs e)
    {
        string redirectlink = "";
        string minexp, fun;
        string mode = clsEncryptionDecryption.EncryptQueryString("ByExperience");
        if (Request.QueryString["roleid"] != null)
            redirectlink = "JobSearchResult.aspx?roleid=" + Request.QueryString["roleid"].ToString() + "&mode=" + mode;
        minexp = ddlMinExpRequired.SelectedValue;
        fun = ddlFunctionalArea.SelectedValue;
        redirectlink = redirectlink + "&functionalarea=" + clsEncryptionDecryption.EncryptQueryString(fun);
        redirectlink = redirectlink + "&minexp=" + clsEncryptionDecryption.EncryptQueryString(minexp);
        Response.Redirect(redirectlink);
    }
    protected void btnClearSearch_Click(object sender, EventArgs e)
    {
        try
        {
            ddlFunctionalArea.SelectedIndex = 0;
            ddlMinExpRequired.SelectedIndex = 0;
        }
        catch (Exception)
        {

            throw;
        }
    }
}
